
class PrintChar {
  constructor(char,num) {
    this.char = char;
    this.num = num;
  }

  for1(){
    for(var i=1;i <= this.num;i++){
      let result = "";
      for(var k =i;k > 0; k--)result += this.char;
      console.log(result);

    }
  }
  for2(){

    for(var i=this.num;i>0;i--){
      let result = "";
      for(var k =i;k > 0; k--)result += this.char;
      console.log(result);

    }
  }
}
var p1 = new PrintChar("A",10);
p1.for1();
console.log("-----------------------");
p1.for2();
